package network.internal.io;

import static commons.Preconditions.checkNotNull;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

import network.io.OutputStreamFactory;

public class DefaultOutputStreamFactory implements
		OutputStreamFactory<Socket, ObjectOutputStream> {

	@Override
	public ObjectOutputStream createOutputStream(final Socket source)
			throws IOException {
		checkNotNull("source must not be null.", source);
		return new ObjectOutputStream(source.getOutputStream());
	}
}
